#include "MPXV5004.h"
#include "../libUDB/libUDB.h"

void MPXV5004callback(void);

int MPXV5004_ADCskips = 0;

void init_MPXV5004(void)
{
	registerA2Dcallback(&MPXV5004callback, MPXV5004_ADC_CHANNEL);
}

void MPXV5004callback(void)
{
	MPXV5004_ADCskips++;

	if(MPXV5004_ADCskips == MPXV5004_ADC_UPDATE_SKIPS)
	{
		MPXV5004_ADCskips = 0;
		int A2DReading = getA2Dreading(MPXV5004_ADC_CHANNEL);
	}	
	
};

void zero_MPXV5004(void)
{
	zeroA2Dchannel(MPXV5004_ADC_CHANNEL);
};
